package job;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;

public class MailJob {
	private static final Log logger = LogFactory.getLog(MailJob.class);

	private MailSender sender;

	private SimpleMailMessage message;

	public void setMessage(SimpleMailMessage message) {
		this.message = message;
	}

	public void setSender(MailSender sender) {
		this.sender = sender;
	}

	public void sendMail() {
		logger.info("sending message:" + message);
		sender.send(message);
		logger.info("send end");
	}
}
